package util.gui;

import org.newdawn.slick.Font;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import util.resource.ResourceManager;

public class Text extends Component
{
	private String text;
	private Font font;
	
	public Text(String text)
	{
		super();
		this.text=text;
		font=ResourceManager.getFont(LookAndFeel.guiFontName);
		super.setWidth(font.getWidth(text));
		super.setHeight(font.getHeight(text));
	}
	
	public void render(GameContainer gc,Graphics g,int x,int y)
	{
		super.render(gc,g,x,y);
		g.setColor(LookAndFeel.textColor);
		g.setFont(font);
		g.drawString(text,x,y);
	}
}
